home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / public / GNU / emacs.inst / emacs19.idb / usr / gnu / lib / emacs / site-lisp / man-frames.el.z / man-frames.el
Encoding:
Text File  |  1994-08-02  |  3.2 KB  |  83 lines

  1. ;; -*- Mode: Emacs-Lisp -*-
  2. ;; File:        man-frames.el
  3. ;; Description:     extension to man.el for X frames
  4. ;; Author:        Dave Goldberg (dsg@mitre.org)
  5. ;; Derived from:    esuperman.el by Colin Rafferty (craffert@lehman.com)
  6. ;; Last Modified:    5-November-1993
  7. ;; Version:        1.2
  8. ;;
  9.  
  10. ;; ========== Standard Disclaimer ==========
  11. ;; This file is not part of the GNU Emacs distribution (yet).
  12.  
  13. ;; This file is distributed in the hope that it will be useful, but
  14. ;; WITHOUT ANY WARRANTY.  No author or distributor accepts
  15. ;; responsibility to anyone for the consequences of using it or for
  16. ;; whether it serves any particular purpose or works at all, unless he
  17. ;; says so in writing.  Refer to the GNU Emacs General Public License
  18. ;; for full details. You should consider this code to be covered under
  19. ;; the terms of the GPL.
  20.  
  21. ;; Everyone is granted permission to copy, modify and redistribute
  22. ;; this file, but only under the conditions described in the GNU Emacs
  23. ;; General Public License.  A copy of this license is supposed to have
  24. ;; been given to you along with GNU Emacs so you can know your rights
  25. ;; and responsibilities.  It should be in a file named COPYING.  Among
  26. ;; other things, the copyright notice and this notice must be
  27. ;; preserved on all copies.
  28.  
  29. ;; History
  30. ;;
  31. ;; In August 1993, I posted version 1.0.1 and called it superman19.el.
  32. ;; At the time I wasn't aware that the man.el in V19 was based on
  33. ;; superman.el.  This is version 1.2.  It basically just renames
  34. ;; everything to work properly with the V19 man.el.  The file name has
  35. ;; changed to man-frames.el and the version number bumped up to 1.2,
  36. ;; mostly because that's what RCS is calling it :-)
  37.  
  38. (require 'man)
  39.  
  40. (defvar Man-frame-parameters nil
  41.   "*Frame parameter list passed to make-frame when creating a new frame
  42. for manual page.")
  43.  
  44. (defvar Man-notify 'newframe
  45.   "*Selects the behavior when manpage is ready.
  46. This variable may have one of the following values:
  47.  
  48. 'newframe   -- put the manpage in its own frame (see variable Man-frame-parameters)
  49. 'bully      -- make the manpage the current buffer and only window
  50. 'aggressive -- make the manpage the current buffer in the other window
  51. 'friendly   -- display manpage in other window but don't make current
  52. 'polite     -- don't display manpage, but prints message when ready (beeps)
  53. 'quiet      -- like 'polite, but don't beep
  54. 'meek       -- make no indication that manpage is ready
  55.  
  56. Any other value of Man-notify is equivalent to 'meek.")
  57.  
  58. (defun Man-notify-when-ready (man-buffer)
  59.   "Notify the user when MAN-BUFFER is ready.
  60. See the variable `Man-notify' for the different notification behaviors."
  61.   (cond
  62.    ((eq Man-notify 'newframe)
  63.     (set-buffer man-buffer)
  64.     (new-frame Man-frame-parameters))
  65.    ((eq Man-notify 'bully)
  66.     (pop-to-buffer man-buffer)
  67.     (delete-other-windows))
  68.    ((eq Man-notify 'aggressive)
  69.     (pop-to-buffer man-buffer))
  70.    ((eq Man-notify 'friendly)
  71.     (display-buffer man-buffer 'not-this-window))
  72.    ((eq Man-notify 'polite)
  73.     (beep)
  74.     (message "Manual buffer %s is ready." (buffer-name man-buffer)))
  75.    ((eq Man-notify 'quiet)
  76.     (message "Manual buffer %s is ready." (buffer-name man-buffer)))
  77.    ((or (eq Man-notify 'meek)
  78.     t)
  79.     (message ""))
  80.    ))
  81.  
  82. (provide 'man-frames)
  83.